import React, { memo, useEffect } from "react"
import { useDispatch, useSelector } from "react-redux"

import DetailPhotos from "./c-cpns/detail-photos"
import DetailInfo from "./c-cpns/detail-info"
import { DetailWrapper } from "./style"
import { changeHeaderConfig } from "@/store/modules/main"
const Detail = memo(() => {
    /** 事件处理逻辑 */
    const { detailInfo } = useSelector((state) => state.detail)
    const dispatch= useDispatch()
    useEffect(() => {
         dispatch(changeHeaderConfig(false))
    })
    return (
        <DetailWrapper>
            <DetailPhotos infoData={detailInfo} />
            <DetailInfo />
        </DetailWrapper>
    )
})

export default Detail
